home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00176_Progress meter wand behavior.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  1.9 KB  |  87 lines

  1. property ptimeElapsed, pSpr
  2.  
  3. on beginSprite me
  4.   pSpr = sprite(me.spriteNum)
  5.   mRefresh(me)
  6.   pSpr.locZ = 97.5
  7.   if inSlotMode() or inRecipeMode() then
  8.     pSpr.visible = 0
  9.   end if
  10. end
  11.  
  12. on endSprite me
  13.   pSpr.visible = 1
  14.   pSpr.locZ = me.spriteNum
  15. end
  16.  
  17. on exitFrame me
  18.   global gMatrixMode, gFloatSprite, gPurgeRAM, gMemPurgeLimit
  19.   if ticksSince(ptimeElapsed) >= 180 then
  20.     mRefresh(me)
  21.     if gMatrixMode then
  22.     end if
  23.     if (the freeBlock < gMemPurgeLimit) and (gPurgeRAM = 1) then
  24.       showMemoryStatus()
  25.       unloadMember()
  26.       showMemoryStatus()
  27.       if the freeBlock < (gMemPurgeLimit * 3) then
  28.         gPurgeRAM = 0
  29.       end if
  30.     end if
  31.   end if
  32. end
  33.  
  34. on mRefresh me
  35.   global gRetrievedGame, gStartRegisterSpr, gEndRegisterSpr, gTipPending, gPearlyGates, gUserQuitFlag
  36.   if gRetrievedGame then
  37.     exit
  38.   end if
  39.   if gPearlyGates or gUserQuitFlag then
  40.     exit
  41.   end if
  42.   if inSlotMode() or inRecipeMode() then
  43.     exit
  44.   end if
  45.   ptimeElapsed = nowTicks()
  46.   if draggingAnything() then
  47.     hideToolTip()
  48.   end if
  49.   timeHere = timeOnThisLevel()
  50.   maxTime = maxTimeOnThisLevel()
  51.   clockScale = clockScaleThisLevel()
  52.   if gTipPending then
  53.     exit
  54.   end if
  55.   if inGameMode() then
  56.     if beyondMaxTips() then
  57.       endOfLevel()
  58.     else
  59.       if timeHere > maxTime then
  60.         if beyondMinTips() then
  61.           endOfLevel()
  62.         else
  63.           if heavenly(checkHiScore(0)) then
  64.             showHeaven()
  65.           else
  66.             endOfLevel()
  67.           end if
  68.         end if
  69.       end if
  70.     end if
  71.   else
  72.     if inBonusMode() then
  73.       if timeHere > maxTime then
  74.         stopMusic()
  75.         soundFX2("bad_drink", 0, 1)
  76.         dismissAllCrap(0)
  77.         go("BonusSummary")
  78.       end if
  79.     end if
  80.   end if
  81.   percent = float(maxTime - timeHere) / max(0.10000000000000001, clockScale)
  82.   newRotation = max(-90, min(integer((180 * percent) - 90), 90))
  83.   if sprite(me.spriteNum).rotation <> newRotation then
  84.     sprite(me.spriteNum).rotation = newRotation
  85.   end if
  86. end
  87.